<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('详细列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var deptId = [[${deptId}]]
    var postId = [[${postId}]]
    var thingId = [[${thingId}]]
    var enterId = [[${enterId}]]

    var prefix = ctx + "financial/fOutbound";

    $(function () {
        var options = {
            url: prefix + "/kucunDetail/"+deptId+"/"+postId+"/"+thingId+"/"+enterId,
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl:  prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            modalName: "详细",
            columns: [{
                checkbox: true
            },
                {
                    field: 'outId',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'thingName',
                    title: '物品目录'
                },
                {
                    field: 'thingType',
                    title: '收支项目'
                },
                {
                    field: 'mohu',
                    title: '物品信息',
                },
                {
                    field: 'shuliang',
                    title: '数量'
                },
                {
                    field: 'pingjunSunhao',
                    title: '人均消耗',
                    formatter: function (value, row, index) {
                        var str = ""
                        if(row.averageSunhao){
                            if(parseFloat(value) > parseFloat(row.averageSunhao)){
                                str = "<span style='color: #ED5565'>"+value+"</span>";
                            }else{
                                str = "<span style='color: #1AB394'>"+value+"</span>";
                            }
                        }else{
                            str = ""+value
                        }
                        return str
                    },
                    sortable: true
                },
                {
                    field: 'averageSunhao',
                    title: '平均消耗',
                },
                {
                    field: 'createBy',
                    title: '出库人'
                }, {
                    field: 'outTime',
                    title: '出库时间',
                    sortable: true
                }]
        };
        $.table.init(options);
    });

</script>
</body>
</html>